home *** CD-ROM | disk | FTP | other *** search
/ Top 200 Programs / Top 200 Programs.iso / Bob8 / THOMPSON / LIBERTY / PRODUCT / TUTORIAL.EXE / TRACKER.BAS < prev    next >
BASIC Source File  |  1996-04-04  |  19KB  |  598 lines

  1.  
  2.  
  3.     'NOTE:  This is the solution to our final lesson.
  4.  
  5.     'TRACKER.BAS
  6.     'Week 6 Liberty BASIC Course
  7.     'Copyright 1996 Shoptalk Systems
  8.     'All Rights Reserved
  9.     'This is our wrap-up application for our Liberty BASIC course
  10.     '------------------------------------------------------------------
  11.  
  12.     'Dimension our sales lead data array for 500 records.
  13.     dim leads$(500, 13)
  14.  
  15.     'Dimension our arrays for displaying names in the listbox.
  16.     dim leadNames$(500)
  17.     dim leadIndices(500)
  18.  
  19.     'Load our bitmaps.
  20.     loadbmp "letter", "letter.bmp"
  21.     loadbmp "call", "call.bmp"
  22.     loadbmp "brochure", "brochure.bmp"
  23.     loadbmp "sale", "sale.bmp"
  24.     loadbmp "deadend", "deadend.bmp"
  25.  
  26.     'Setup our listbox choices.
  27.     dim eventTypes$(6)
  28.     eventTypes$(0) = "all"
  29.     eventTypes$(1) = "letter"
  30.     eventTypes$(2) = "call"
  31.     eventTypes$(3) = "brochure"
  32.     eventTypes$(4) = "sale"
  33.     eventTypes$(5) = "deadend"
  34.     eventFilter$ = "all"
  35.  
  36.  
  37.     'No main window
  38.     nomainwin
  39.  
  40.     'Set the size of our Window.
  41.     WindowWidth = 400
  42.     WindowHeight = 280
  43.  
  44.  
  45.     'Set up the controls and open the window.
  46.     groupbox #main, "", 191, 111, 184, 130
  47.     statictext #main.statictext1, "Sales Leads", 15, 16, 104, 20
  48.     listbox #main.leads, leadNames$(, [leadSelected], 15, 41, 160, 200
  49.     statictext #main.statictext3, "Filter Leads By:", 191, 16, 128, 20
  50.     combobox #main.eventTypes, eventTypes$(, [selectEventType], 191, 41, 144, 115
  51.     button #main.actionButton, "GO!", [action], UL, 319, 76, 56, 20
  52.     statictext #main.action, "No Action", 191, 76, 104, 20
  53.     statictext #main.statictext7, "->", 295, 76, 16, 20
  54.     graphicbox #main.icon, 343, 31, 34, 34
  55.     button #main, "Edit/View Record", [editSalesLead], UL, 207, 131, 152, 20
  56.     button #main, "New Record", [newSalesLead], UL, 207, 156, 152, 20
  57.     button #main, "Edit Letter", [editLetter], UL, 207, 181, 152, 20
  58.     button #main, "Edit Packslip", [editPackslip], UL, 207, 206, 152, 20
  59.     open "Tracker" for dialog as #main
  60.     print #main, "trapclose [quit]"
  61.     print #main.eventTypes, "select all"
  62.     print #main.leads, "singleclickselect"
  63.  
  64.  
  65.     'Check to see if our sales lead file exists.
  66.     dim check$(1,1)
  67.     files DefaultDir$, "leads.dat", check$(
  68.     if val(check$(0, 0)) = 1 then gosub [loadLeads]
  69.  
  70.     gosub [loadNamesList]  'load the listbox
  71.  
  72.  
  73. [mainLoop]  'wait here for user input
  74.     input r$
  75.     goto [mainLoop]
  76.  
  77.  
  78. [quit]  'exit the program
  79.  
  80.     gosub [saveLeads]
  81.     close #main
  82.     end
  83.  
  84.  
  85.  
  86. ' ==MAIN WINDOW BEHAVIOR==================================================
  87.  
  88. ' This code section manages the listbox, combobox, statictext and other
  89. ' controls in the main window, and their interaction with each other.
  90.  
  91. [loadNamesList]  'fill up our names list with names as appropriate
  92.  
  93.     if leadCount = 0 then return  'no leads loaded
  94.  
  95.     nameCount = 0
  96.     for x = 0 to leadCount - 1
  97.         leadNames$(x) = ""
  98.         if leads$(x, 9) = eventFilter$ or eventFilter$ = "all" then _
  99.             leadNames$(nameCount) = leads$(x, 0) + ", " + leads$(x, 1) : _
  100.             leadIndices(nameCount) = x : _
  101.             nameCount = nameCount + 1
  102.     next x
  103.  
  104.     print #main.leads, "reload"
  105.  
  106.   return
  107.  
  108.  
  109. [selectEventType]  'draw the icon for the selected status
  110.  
  111.     print #main.eventTypes, "selection?"
  112.     input #main.eventTypes, eventFilter$
  113.  
  114.  
  115.     print #main.icon, "cls"
  116.     if eventFilter$ <> "all" then _
  117.         print #main.icon, "drawbmp "; eventFilter$; " 0 0 ; flush"
  118.  
  119.     gosub [loadNamesList]
  120.     gosub [updateAction]
  121.  
  122.     goto [mainLoop]
  123.  
  124.  
  125. [updateAction]  'Display what the valid action is now.
  126.  
  127.     print #main.leads, "selectionindex?"
  128.     input #main.leads, index
  129.  
  130.     action$ = "No Action"
  131.     if eventFilter$ = "letter" and nameCount > 0 then _
  132.         action$ = "Print Letter(s)"
  133.     if eventFilter$ = "call" and nameCount > 0 and index > 0 then _
  134.         action$ = "Make Call"
  135.     if eventFilter$ = "brochure" and nameCount > 0 and index > 0 then _
  136.         action$ = "Sale is Made"
  137.     print #main.action, action$
  138.  
  139.   return
  140.  
  141.  
  142. [action]  'perform the appropriate action for the GO button
  143.  
  144.     if action$ = "No Action" then [mainLoop]
  145.  
  146.     if action$ = "Print Letter(s)" then [printLetters]
  147.     if action$ = "Make Call" then [makeCall]
  148.     if action$ = "Sale is Made" then [receivedOrder]
  149.  
  150.     goto [mainLoop]
  151.  
  152.  
  153. [leadSelected]  'A sales lead was selected.  Update the action.
  154.  
  155.     gosub [updateAction]
  156.  
  157.     goto [mainLoop]
  158.  
  159.  
  160.  
  161. ' ==LOAD/SAVE SALES LEADS================================================
  162.  
  163. ' This code section contains code for loading and saving our sales lead
  164. ' data
  165.  
  166. [loadLeads]  'Load the leads.dat file.
  167.  
  168.     'The first line of the file contains a count of the records in
  169.     'the file.
  170.     'Each record consists of the following fields on it's own line
  171.     'so we can use LINE INPUT to read the file.
  172.  
  173.     '0   Last Name
  174.     '1   First Name and middle initial
  175.     '2   Street address 1
  176.     '3   Street address 2
  177.     '4   City
  178.     '5   State
  179.     '6   Zip Code
  180.     '7   Phone #
  181.     '8   Comment
  182.     '9   Event (letter, call, etc)
  183.     '10  Date of last action
  184.     '11  Status of call
  185.     '12  Dead end flag (0 or 1)
  186.  
  187.     open "leads.dat" for input as #leadsIn
  188.     input #leadsIn, leadCount
  189.     for x = 0 to leadCount - 1
  190.         for y = 0 to 12
  191.             line input #leadsIn, leadData$
  192.             leads$(x, y) = leadData$
  193.         next y
  194.     next x
  195.  
  196.     close #leadsIn
  197.  
  198.   return
  199.  
  200.  
  201. [saveLeads]  'save our leads data to leads.dat
  202.  
  203.     open "leads.dat" for output as #leadsOut
  204.     print #leadsOut, leadCount
  205.     for x = 0 to leadCount - 1
  206.         for y = 0 to 12
  207.             print #leadsOut, leads$(x, y)
  208.         next y
  209.     next x
  210.  
  211.     close #leadsOut
  212.  
  213.   return
  214.  
  215.  
  216.  
  217. ' ==PRINTING FORM LETTERS==================================================
  218.  
  219. ' This code section contains code that prints our form letter or letters.
  220.  
  221. [printLetters]  'print form letters
  222.  
  223.     'Check to see if our letter.txt file exists.
  224.     files DefaultDir$, "letter.txt", check$(
  225.     if val(check$(0, 0)) = 0 then _
  226.         notice "File LETTER.TXT is not available.  Cannot print letter." : _
  227.         goto [mainLoop]
  228.  
  229.     print #main.leads, "selectionindex?"
  230.     input #main.leads, index
  231.     if index > 0 then recordIndex = leadIndices(index - 1)
  232.  
  233.     'print a single letter if a sales lead is selected
  234.     if index > 0 then _
  235.         gosub [printLetterNow] : _
  236.         gosub [loadNamesList] : _
  237.         goto [mainLoop]
  238.  
  239.     confirm "Print letter for all entries?"; answer$
  240.     if answer$ = "yes" then [printAllLetters]
  241.  
  242.     goto [mainLoop]
  243.  
  244.  
  245. [printAllLetters]  'print all the letters
  246.  
  247.     for x = 0 to nameCount - 1
  248.         recordIndex = leadIndices(x)
  249.         gosub [printLetterNow]
  250.     next x
  251.  
  252.     gosub [loadNamesList]
  253.  
  254.     goto [mainLoop]
  255.  
  256.  
  257. [printLetterNow]  'print a single letter from letter.txt
  258.  
  259.     open "letter.txt" for input as #letter
  260.     while eof(#letter) = 0
  261.         line input #letter, aLine$
  262.         while instr(aLine$, "<nameTag>") > 0
  263.             aLine$ = left$(aLine$, instr(aLine$, "<nameTag>") - 1) + _
  264.                 leads$(recordIndex, 1) + " " + leads$(recordIndex, 0) + _
  265.                 mid$(aLine$, instr(aLine$, "<nameTag>") + 9)
  266.         wend
  267.         while instr(aLine$, "<dateTag>") > 0
  268.             aLine$ = left$(aLine$, instr(aLine$, "<dateTag>") - 1) + _
  269.                 date$() + mid$(aLine$, instr(aLine$, "<dateTag>") + 9)
  270.         wend
  271.         lprint aLine$
  272.     wend
  273.     dump
  274.     close #letter
  275.     leads$(recordIndex, 9) = "call"    'set new event status
  276.     leads$(recordIndex, 10) = date$()  'set date of last action to today
  277.  
  278.   return
  279.  
  280.  
  281. [editLetter]  'Run Notepad to edit letter.txt
  282.  
  283.     run "notepad.exe " + DefaultDir$ + "\letter.txt"
  284.  
  285.     goto [mainLoop]
  286.  
  287.  
  288. [editPackslip]  'Run Notepad to edit packslip.txt
  289.  
  290.     run "notepad.exe " + DefaultDir$ + "\packslip.txt"
  291.  
  292.     goto [mainLoop]
  293.  
  294.  
  295.  
  296. ' ==ENTER NEW LEAD OR EDIT AN EXISTING LEAD================================
  297.  
  298. ' This section of code opens a dialog box for either entering a new lead
  299. ' record, or for editing an existing one.  There are a couple of subroutines
  300. ' in this section to share common code for the new lead and edit lead parts.
  301.  
  302. [newSalesLead]  'Open a window for creating a new lead record.
  303.  
  304.     gosub [setupCommonControls]
  305.  
  306.     button #leadInfo.default, "&Accept", [acceptNewLeadInfo], UL, 319, 16, 64, 25
  307.     button #leadInfo.button20, "&Cancel", [cancelLeadInfo], UL, 319, 51, 64, 25
  308.     open "Add New Sales Lead" for dialog_modal as #leadInfo
  309.     print #leadInfo, "trapclose [acceptNewLeadInfo]"
  310.  
  311.     goto [mainLoop]
  312.  
  313.  
  314. [acceptNewLeadInfo]   'Accept the new lead info.
  315.  
  316.     recordIndex = leadCount
  317.     gosub [sharedAcceptCode]
  318.     close #leadInfo
  319.     leads$(leadCount, 9) = "letter"
  320.     leads$(leadCount, 12) = "0"
  321.     leadCount = leadCount + 1
  322.     gosub [loadNamesList]
  323.  
  324.     goto [mainLoop]
  325.  
  326.  
  327. [acceptLeadInfo]   'Accept the edited lead info.
  328.  
  329.     gosub [sharedAcceptCode]
  330.     close #leadInfo
  331.     gosub [loadNamesList]
  332.  
  333.     goto [mainLoop]
  334.  
  335.  
  336. [cancelLeadInfo]  'Close the lead info window.  Don't save info
  337.  
  338.     close #leadInfo
  339.  
  340.     goto [mainLoop]
  341.  
  342.  
  343. [sharedAcceptCode]  'This code is used by both New and Edit sales leads.
  344.  
  345.     print #leadInfo.firstName, "!contents?";
  346.     input #leadInfo.firstName, text$
  347.     leads$(recordIndex, 1) = text$
  348.     print #leadInfo.lastName, "!contents?";
  349.     input #leadInfo.lastName, text$
  350.     leads$(recordIndex, 0) = text$
  351.     print #leadInfo.phone, "!contents?";
  352.     input #leadInfo.phone, text$
  353.     leads$(recordIndex, 7) = text$
  354.     print #leadInfo.address, "!contents?";
  355.     input #leadInfo.address, text$
  356.     leads$(recordIndex, 2) = text$
  357.     print #leadInfo.address2, "!contents?";
  358.     input #leadInfo.address2, text$
  359.     leads$(recordIndex, 3) = text$
  360.     print #leadInfo.city, "!contents?";
  361.     input #leadInfo.city, text$
  362.     leads$(recordIndex, 4) = text$
  363.     print #leadInfo.state, "!contents?";
  364.     input #leadInfo.state, text$
  365.     leads$(recordIndex, 5) = text$
  366.     print #leadInfo.zip, "!contents?";
  367.     input #leadInfo.zip, text$
  368.     leads$(recordIndex, 6) = text$
  369.     print #leadInfo.comment, "!contents?";
  370.     input #leadInfo.comment, text$
  371.     leads$(recordIndex, 8) = text$
  372.  
  373.   return
  374.  
  375.  
  376. [editSalesLead]  'open a window for editing a lead record
  377.  
  378.     print #main.leads, "selectionindex?"
  379.     input #main.leads, index
  380.     if index = 0 then [mainLoop]
  381.     recordIndex = leadIndices(index - 1)
  382.  
  383.     gosub [setupCommonControls]
  384.  
  385.     button #leadInfo.default, "&Accept", [acceptLeadInfo], UL, 319, 16, 64, 25
  386.     button #leadInfo.button20, "&Cancel", [cancelLeadInfo], UL, 319, 51, 64, 25
  387.     open "Edit Sales Lead" for dialog_modal as #leadInfo
  388.     print #leadInfo, "trapclose [acceptLeadInfo]"
  389.  
  390.     print #leadInfo.firstName, leads$(recordIndex, 1)
  391.     print #leadInfo.lastName, leads$(recordIndex, 0)
  392.     print #leadInfo.phone, leads$(recordIndex, 7)
  393.     print #leadInfo.address, leads$(recordIndex, 2)
  394.     print #leadInfo.address2, leads$(recordIndex, 3)
  395.     print #leadInfo.city, leads$(recordIndex, 4)
  396.     print #leadInfo.state, leads$(recordIndex, 5)
  397.     print #leadInfo.zip, leads$(recordIndex, 6)
  398.     print #leadInfo.comment, leads$(recordIndex, 8)
  399.  
  400.     goto [mainLoop]
  401.  
  402.  
  403. [setupCommonControls]
  404.  
  405.     WindowWidth = 408
  406.     WindowHeight = 295
  407.  
  408.     textbox #leadInfo.firstName, 103, 16, 200, 25
  409.     statictext #leadInfo.statictext1, "Last Name", 15, 51, 80, 20
  410.     textbox #leadInfo.lastName, 103, 46, 200, 25
  411.     statictext #leadInfo.statictext3, "First Name", 15, 21, 80, 20
  412.     textbox #leadInfo.phone, 103, 76, 200, 25
  413.     statictext #leadInfo.statictext5, "Address 1", 15, 111, 80, 20
  414.     textbox #leadInfo.address, 103, 106, 200, 25
  415.     statictext #leadInfo.statictext7, "Address 2", 15, 141, 80, 20
  416.     textbox #leadInfo.address2, 103, 136, 200, 25
  417.     statictext #leadInfo.statictext9, "City", 15, 171, 40, 20
  418.     textbox #leadInfo.city, 103, 166, 200, 25
  419.     statictext #leadInfo.statictext11, "State", 15, 201, 48, 20
  420.     textbox #leadInfo.state, 103, 196, 48, 25
  421.     statictext #leadInfo.statictext13, "Zip", 167, 201, 32, 20
  422.     textbox #leadInfo.zip, 199, 196, 104, 25
  423.     statictext #leadInfo.statictext16, "Phone #", 15, 81, 56, 20
  424.     statictext #leadInfo.statictext17, "Comment", 15, 231, 56, 20
  425.     textbox #leadInfo.comment, 103, 226, 200, 25
  426.  
  427.   return
  428.  
  429.  
  430.  
  431. ' ==FOLLOW UP CALL===========================================================
  432.  
  433. [makeCall]  'display phone call information for making a call
  434.  
  435.     WindowWidth = 312
  436.     WindowHeight = 200
  437.  
  438.     statictext #phoneCall.name, "-name-", 31, 21, 240, 20
  439.     statictext #phoneCall.phone, "-phone-", 31, 41, 240, 20
  440.     statictext #phoneCall.lastAction, "-date-", 31, 61, 240, 20
  441.     statictext #phoneCall.statictext5, "Comment", 15, 96, 64, 20
  442.     textbox #phoneCall.comment, 87, 91, 200, 25
  443.     button #phoneCall.button3, "No Contact", [callNoContact], UL, 15, 131, 80, 25
  444.     button #phoneCall.button4, "Contact Made", [callContactMade], UL, 103, 131, 104, 25
  445.     button #phoneCall.button7, "Dead End", [callDeadEnd], UL, 215, 131, 72, 25
  446.     open "Make Phone Call" for dialog_modal as #phoneCall
  447.     print #phoneCall, "trapclose [callNoContact]"
  448.  
  449.     recordIndex = leadIndices(index - 1)
  450.     print #phoneCall.name, leads$(recordIndex, 1); " "; leads$(recordIndex, 0)
  451.     print #phoneCall.phone, leads$(recordIndex, 7)
  452.     print #phoneCall.lastAction, "Opening letter sent: "; leads$(recordIndex, 10)
  453.     print #phoneCall.comment, leads$(recordIndex, 8)
  454.  
  455.     goto [mainLoop]
  456.  
  457.  
  458. [callNoContact]   'No contact.  Close the window.
  459.  
  460.     gosub [callGetComment]
  461.     close #phoneCall
  462.  
  463.     goto [mainLoop]
  464.  
  465.  
  466. [callContactMade]   'Contact is made!  Upgrade to brochure event status
  467.  
  468.     gosub [callGetComment]
  469.     leads$(recordIndex, 9) = "brochure"
  470.     leads$(recordIndex, 10) = date$()
  471.     close #phoneCall
  472.  
  473.     goto [mainLoop]
  474.  
  475.  
  476. [callDeadEnd]   'Perform action for the button named 'button7'
  477.  
  478.     gosub [callGetComment]
  479.     leads$(recordIndex, 9) = "deadend"
  480.     leads$(recordIndex, 10) = date$()
  481.     close #phoneCall
  482.  
  483.     goto [mainLoop]
  484.  
  485.  
  486. [callGetComment]  'shared code for extracting the comment field
  487.  
  488.     print #phoneCall.comment, "!contents?";
  489.     input #phoneCall.comment, answer$
  490.     leads$(recordIndex, 8) = answer$
  491.  
  492.   return
  493.  
  494.  
  495. ' ==SALE IS MADE============================================================
  496.  
  497. ' This section of the program displays a sales lead and gives the option to
  498. ' print a packing slip and update the lead's status to sale.
  499.  
  500. [receivedOrder]  'The customer ordered after receiving brochure!
  501.  
  502.     WindowWidth = 312
  503.     WindowHeight = 200
  504.  
  505.     statictext #brochure.name, "-name-", 31, 21, 240, 20
  506.     statictext #brochure.phone, "-phone-", 31, 41, 240, 20
  507.     statictext #brochure.lastAction, "-date-", 31, 61, 240, 20
  508.     statictext #brochure, "Comment", 15, 96, 64, 20
  509.     textbox #brochure.comment, 87, 91, 200, 25
  510.     button #brochure.button3, "&Print Slip!", [printSlip], UL, 15, 131, 192, 25
  511.     button #brochure.button4, "&Cancel", [cancelNoOrder], UL, 215, 131, 72, 25
  512.     open "Brochure Inspires Sale!" for dialog_modal as #brochure
  513.     print #brochure, "trapclose [cancelNoOrder]"
  514.  
  515.     recordIndex = leadIndices(index - 1)
  516.     print #brochure.name, leads$(recordIndex, 1); " "; leads$(recordIndex, 0)
  517.     print #brochure.phone, leads$(recordIndex, 7)
  518.     print #brochure.lastAction, "Brochure was sent: "; leads$(recordIndex, 10)
  519.     print #brochure.comment, leads$(recordIndex, 8)
  520.  
  521.     goto [mainLoop]
  522.  
  523.  
  524. [cancelNoOrder]   'No sale.  Close the window.
  525.  
  526.     gosub [orderGetComment]
  527.     close #brochure
  528.  
  529.     goto [mainLoop]
  530.  
  531.  
  532. [printSlip]   'Sale is made!  Upgrade to sale event status and print slip
  533.  
  534.     gosub [orderGetComment]
  535.     leads$(recordIndex, 9) = "sale"
  536.     leads$(recordIndex, 10) = date$()
  537.     close #brochure
  538.  
  539.     'Check to see if our packslip file exists.
  540.     files DefaultDir$, "packslip.txt", check$(
  541.     if val(check$(0, 0)) = 0 then _
  542.         notice "PACKSLIP.TXT not found.  Can't print packing slip!" : _
  543.         goto [mainLoop]
  544.  
  545.     open "packslip.txt" for input as #packslip
  546.     while eof(#packslip) = 0
  547.         line input #packslip, aLine$
  548.         while instr(aLine$, "<nameTag>") > 0
  549.             aLine$ = left$(aLine$, instr(aLine$, "<nameTag>") - 1) + _
  550.                 leads$(recordIndex, 1) + " " + leads$(recordIndex, 0) + _
  551.                 mid$(aLine$, instr(aLine$, "<nameTag>") + 9)
  552.         wend
  553.         while instr(aLine$, "<address1Tag>") > 0
  554.             aLine$ = left$(aLine$, instr(aLine$, "<address1Tag>") - 1) + _
  555.                 leads$(recordIndex, 2) + _
  556.                 mid$(aLine$, instr(aLine$, "<address1Tag>") + 13)
  557.         wend
  558.         while instr(aLine$, "<address2Tag>") > 0
  559.             aLine$ = left$(aLine$, instr(aLine$, "<address2Tag>") - 1) + _
  560.                 leads$(recordIndex, 3) + _
  561.                 mid$(aLine$, instr(aLine$, "<address2Tag>") + 13)
  562.         wend
  563.         while instr(aLine$, "<cityTag>") > 0
  564.             aLine$ = left$(aLine$, instr(aLine$, "<cityTag>") - 1) + _
  565.                 leads$(recordIndex, 4) + _
  566.                 mid$(aLine$, instr(aLine$, "<cityTag>") + 9)
  567.         wend
  568.         while instr(aLine$, "<stateTag>") > 0
  569.             aLine$ = left$(aLine$, instr(aLine$, "<stateTag>") - 1) + _
  570.                 leads$(recordIndex, 5) + _
  571.                 mid$(aLine$, instr(aLine$, "<stateTag>") + 10)
  572.         wend
  573.         while instr(aLine$, "<zipTag>") > 0
  574.             aLine$ = left$(aLine$, instr(aLine$, "<zipTag>") - 1) + _
  575.                 leads$(recordIndex, 6) + _
  576.                 mid$(aLine$, instr(aLine$, "<zipTag>") + 8)
  577.         wend
  578.         while instr(aLine$, "<dateTag>") > 0
  579.             aLine$ = left$(aLine$, instr(aLine$, "<dateTag>") - 1) + _
  580.                 date$() + mid$(aLine$, instr(aLine$, "<dateTag>") + 9)
  581.         wend
  582.         lprint aLine$
  583.     wend
  584.     dump
  585.     close #packslip
  586.  
  587.     goto [mainLoop]
  588.  
  589.  
  590. [orderGetComment]  'shared code for extracting the comment field
  591.  
  592.     print #brochure.comment, "!contents?";
  593.     input #brochure.comment, answer$
  594.     leads$(recordIndex, 8) = answer$
  595.  
  596.   return
  597.  
  598.